import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mvvm/provider/home_page/counter1.dart';
import 'package:provider/provider.dart';

class MyGestureDetector1 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var counter1 = context.watch<CounterInt>();

    int value1 = context.select((CounterInt counter1) => counter1.value1);

    return GestureDetector(
      child: Text(
        '${value1}',
        style: Theme.of(context).textTheme.headline4,
      ),
      onTap: () {
        // var counter = context.read<Counter>();
        counter1.increment1();
      },
    );
  }
}